home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / B-C / C++ FAQ Reference 1.0 / C++ FAQ Reference 1.0.rsrc / TEXT_1037.txt < prev    next >
Encoding:
Text File  |  1993-06-30  |  673 b   |  3 lines

  1. Yes but you shouldn't.  The only time you should do this is to get around the 'hiding rule' (see below, and ARM sect.13.1), and the overridden definition should be textually identical to the base class' version.
  2.  
  3. The above advice will keep you out of trouble, but it is a bit too strong. Experienced C++ programmers will sometimes override a non-virtual fn for efficiency, and will provide an alternate implementation which makes better use of the derived class' resources.  However the client-visible effects must be *identical*, since non-virtual fns are dispatched based on the static type of the ptr/ref rather than the dynamic type of the pointed-to/referenced object.